import {Instance} from "../utils/AxiosUtils";
import {LoginInfoTemp} from "../utils/types/LoginTepm";
import {GamePrefer, UserTemp} from "../utils/types/UserInfo";


export const UserCheckState = () => Instance.get("/user/updateState")
export const UserDetailGet = () => Instance.get("/user/detail")
export const UserInfoGet = () => Instance.get("/user/info")
export const UserFriendsGet = () => Instance.get("/user/friends")
export const UserFriendsReq = (data: UserTemp) => Instance.post("/user/friendsReq", data)
export const UserGetInfoById = (data: UserTemp) => Instance.post("/user/getInfoById", data)
export const UserUpdateInfo = (data: UserTemp) => Instance.post("/user/infoUpdate", data)
export const UserUpdateEmail = (data: LoginInfoTemp) => Instance.post("/user/emailUpdate", data)
export const UserUpdateImg = (data: UserTemp) => Instance.post("/user/updateImg", data)
export const UserEmailGet = () => Instance.get("/user/email")
export const UserGamesGet = () => Instance.get("/user/games")
export const UserGamePreferGet = (data: Map<number, GamePrefer>) => Instance.post("/user/gamePrefer", data)

export const GamePreferStarChange = (data: Map<number, number> | undefined) => Instance.post("/user/gamePreferChange", data,)
export const UserDiscovery = (data: UserTemp) => Instance.post("/user/discovery", data)
